package com.gjzhao.fmmall.vo;

import com.gjzhao.fmmall.annotation.FlagValidator;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.Min;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * @Description: 商品品牌 (todo 暂时没有数据表, 测试 Hibernate Validator 校验框架[SpringBoot默认集成该框架])
 *  注解详情：
 *     - @Min：被注释的属性必须大于等于其value值；
 *     - @Max：被注释的属性必须小于等于其value值；
 *     - @NotEmpty：被注释的属性不能为空；
 *     - @FlagValidator 自定义校验注解(必须是value数组中定义的值，否则会报message中的错误)
 * @Author: gjzhao
 * @Date Created in 2022-01-24 9:58 上午
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class BrandVO {

    @ApiModelProperty(value = "品牌名称", required = true)
    @NotEmpty(message = "名称不能为空")
    private String name;

    @ApiModelProperty(value = "品牌首字母")
    private String firstLetter;

    @ApiModelProperty(value = "排序字段")
    @Min(value = 0, message = "排序最小为0")
    private Integer sort;

    @ApiModelProperty(value = "是否为厂家制造商")
    @FlagValidator(value = {"0","1"},message ="状态值不正确")
    private Integer factoryStatus;

    @ApiModelProperty(value = "是否进行显示")
    private Integer showStatus;

    @ApiModelProperty(value = "品牌logo", required = true)
    @NotEmpty(message = "品牌logo不能为空")
    private String logo;

    @ApiModelProperty(value = "品牌大图")
    private String bigPic;

    @ApiModelProperty(value = "品牌故事")
    private String brandStory;

}
